package com.ajk.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ajk.server.dao.provider.PartientEventExtProvider;
import com.ajk.server.model.PartientEventExt;
import com.ajk.server.model.query.PartientEventExtQuery;
/**
 * 用户健康数据扩展表  <br>
 * t_partient_event_ext <br>
 * v1.0 2016-04-20
 */
 @CacheNamespace(implementation=org.mybatis.caches.ehcache.EhcacheCache.class)
 public interface PartientEventExtMapper {
 	
 	/**
 	*根据ID删除 用户健康数据扩展表
 	*/
 	@Delete("delete from t_partient_event_ext where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	/**
 	*新增 用户健康数据扩展表
 	*/
 	@InsertProvider(method="batchInsertPartientEventExt",type=PartientEventExtProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsertPartientEventExt(List<PartientEventExt> partientEventExts);
 	
 	/**
 	*新增 用户健康数据扩展表
 	*/
 	@InsertProvider(method="insertPartientEventExt",type=PartientEventExtProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insertPartientEventExt(PartientEventExt domain);
 
 	
 	/**
 	*更新 用户健康数据扩展表
 	*/
 	@UpdateProvider(method="updatePartientEventExt",type=PartientEventExtProvider.class)
 	public Integer updatePartientEventExt(PartientEventExt domain);
 	
 	
    /**
 	*根据ID查询 用户健康数据扩展表
 	*/
	@Select("select * from t_partient_event_ext where id=#{id}")
	public PartientEventExt findById(Integer id);
	
	@Select("select * from t_partient_event_ext where id=#{id}")
	@Options(flushCache=true)
	public PartientEventExt findByIdWithOutCache(Integer id);
	
	
 	
 	/**
 	*通过query 查询 用户健康数据扩展表
 	*/
 
 	@SelectProvider(method="findByQuery",type=PartientEventExtProvider.class)
 	public List<PartientEventExt> findByQuery(PartientEventExtQuery query);
 	
 	@SelectProvider(method="findByQuery",type=PartientEventExtProvider.class)
 	@Options(flushCache=true)
 	public List<PartientEventExt> findByQueryWithOutCache(PartientEventExtQuery query);
 	
 	@SelectProvider(method="countByQuery",type=PartientEventExtProvider.class)
 	public Integer countByQuery(PartientEventExtQuery query);
 	
 	@SelectProvider(method="countByQuery",type=PartientEventExtProvider.class)
 	@Options(flushCache=true)
 	public Integer countByQueryWithOutCache(PartientEventExtQuery query);
 	
 	
 	@SelectProvider(method="findByIds",type=PartientEventExtProvider.class)
 	public List<PartientEventExt> findByIds(List<Integer> ids);
 	
}	